// $ANTLR : "Analizador2.g" -> "AnasintTeclado.java"$
 
/* código de cabecera */ 
	package practica3;

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;

public class AnasintTeclado extends antlr.LLkParser       implements AnasintTecladoTokenTypes
 {

	private boolean result = false;
	public boolean getResult() {return result;}

protected AnasintTeclado(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public AnasintTeclado(TokenBuffer tokenBuf) {
  this(tokenBuf,1);
}

protected AnasintTeclado(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public AnasintTeclado(TokenStream lexer) {
  this(lexer,1);
}

public AnasintTeclado(ParserSharedInputState state) {
  super(state,1);
  tokenNames = _tokenNames;
}

	public final void entrada() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			{
			_loop3:
			do {
				switch ( LA(1)) {
				case SET:
				{
					asignacionVarDef();
					break;
				}
				case IDENT:
				{
					asignacion();
					break;
				}
				default:
				{
					break _loop3;
				}
				}
			} while (true);
			}
			match(Token.EOF_TYPE);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
	}
	
	public final void asignacionVarDef() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(SET);
			match(IDENT_SET);
			match(OPERADOR);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case TRUE:
			{
				match(TRUE);
				break;
			}
			case FALSE:
			{
				match(FALSE);
				break;
			}
			case PATH:
			{
				match(PATH);
				break;
			}
			case CADENA:
			{
				match(CADENA);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			switch ( LA(1)) {
			case IF:
			{
				condicional();
				break;
			}
			case WHILE:
			{
				reglawhile();
				break;
			}
			case FOR:
			{
				reglafor();
				break;
			}
			case EOF:
			case SET:
			case IDENT:
			case LLAVE_C:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			result = true;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void asignacion() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(IDENT);
			match(OPERADOR);
			{
			switch ( LA(1)) {
			case NUMERO:
			{
				match(NUMERO);
				break;
			}
			case TRUE:
			{
				match(TRUE);
				break;
			}
			case FALSE:
			{
				match(FALSE);
				break;
			}
			case PATH:
			{
				match(PATH);
				break;
			}
			case CADENA:
			{
				match(CADENA);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			result = true;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
	}
	
	public final void condicional() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(IF);
			match(PARENTESIS_A);
			match(IDENT_SET);
			match(PARENTESIS_C);
			match(LLAVE_A);
			{
			int _cnt11=0;
			_loop11:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					asignacionVarDef();
					break;
				}
				default:
				{
					if ( _cnt11>=1 ) { break _loop11; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt11++;
			} while (true);
			}
			match(LLAVE_C);
			result = true;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void reglawhile() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(WHILE);
			match(PARENTESIS_A);
			match(IDENT_SET);
			match(PARENTESIS_C);
			match(LLAVE_A);
			{
			int _cnt14=0;
			_loop14:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					asignacionVarDef();
					break;
				}
				default:
				{
					if ( _cnt14>=1 ) { break _loop14; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt14++;
			} while (true);
			}
			match(LLAVE_C);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	public final void reglafor() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(FOR);
			match(PARENTESIS_A);
			asignacion();
			match(SEPARADOR);
			match(IDENT);
			{
			switch ( LA(1)) {
			case MAYOR:
			{
				match(MAYOR);
				break;
			}
			case MENOR:
			{
				match(MENOR);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(NUMERO);
			match(SEPARADOR);
			match(IDENT);
			{
			switch ( LA(1)) {
			case MAS:
			{
				{
				match(MAS);
				}
				{
				match(MAS);
				}
				break;
			}
			case MENOS:
			{
				{
				match(MENOS);
				}
				{
				match(MENOS);
				}
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(PARENTESIS_C);
			match(LLAVE_A);
			{
			int _cnt23=0;
			_loop23:
			do {
				switch ( LA(1)) {
				case IDENT:
				{
					asignacion();
					break;
				}
				case SET:
				{
					asignacionVarDef();
					break;
				}
				default:
				{
					if ( _cnt23>=1 ) { break _loop23; } else {throw new NoViableAltException(LT(1), getFilename());}
				}
				}
				_cnt23++;
			} while (true);
			}
			match(LLAVE_C);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"\"SET\"",
		"\"IF\"",
		"\"TRUE\"",
		"\"FALSE\"",
		"\"WHILE\"",
		"\"FOR\"",
		"BLANCO",
		"LETRA",
		"DIGITO",
		"SLASH",
		"COMILLAS",
		"NUMERO",
		"IDENT",
		"IDENT_SET",
		"SEPARADOR",
		"OPERADOR",
		"DOLAR",
		"LLAVE_A",
		"LLAVE_C",
		"PARENTESIS_A",
		"PARENTESIS_C",
		"MAS",
		"MENOS",
		"MAYOR",
		"MENOR",
		"PATH",
		"CADENA"
	};
	
	private static final long[] mk_tokenSet_0() {
		long[] data = { 2L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
	private static final long[] mk_tokenSet_1() {
		long[] data = { 4259858L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
	private static final long[] mk_tokenSet_2() {
		long[] data = { 4522002L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
	
	}
